package com.atos.howl.chaos.pdm.service.impl;

import com.atos.howl.chaos.pdm.dto.paihangbang.PaihangbangDTO;
import com.atos.howl.chaos.pdm.dto.paihangbang.VideoTop;
import com.atos.howl.chaos.pdm.mapper.PaihangbangMapper;
import com.atos.howl.chaos.pdm.service.PaihangbangService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Howl-Xu
 * @version 1.0.0
 * @Description: 请描述一下这个类文件吧
 * @createTime 2020年02月20日 17:40:00
 */

@Service
public class PaihangbangServiceImpl implements PaihangbangService {

    @Resource
    private PaihangbangMapper paihangbangMapper;
    @Override
    public List<VideoTop> searchPaihangbangTop11(PaihangbangDTO paihangbangDTO) {

        String fenquParent = paihangbangDTO.getFenquParent();
        String is1day = paihangbangDTO.getIs1day();
        String is3day = paihangbangDTO.getIs3day();
        String is7day = paihangbangDTO.getIs7day();

        List<VideoTop> videoList = null;

        if(is1day.equals("1")){
            videoList = paihangbangMapper.searchPaihangbangTop11();
//            videoList = paihangbangService.searchPaihangbangTop10(paihangbangDTO);
        }

        if(is3day.equals("1")){
            videoList = paihangbangMapper.searchPaihangbangTop11();
//            videoList = paihangbangService.searchPaihangbangTop10(fenquParent,3);
        }

        if(is7day.equals("1")){
            videoList = paihangbangMapper.searchPaihangbangTop11();
//            videoList = paihangbangService.searchPaihangbangTop10(fenquParent,7);
        }

        return videoList;
    }

    @Override
    public List<VideoTop> getPaihangbangTop9(PaihangbangDTO paihangbangDTO) {
        List<VideoTop> videoList = null;
        videoList = paihangbangMapper.searchPaihangbangTop9();
        return videoList;
    }

    @Override
    public List<VideoTop> getPaihangbangTop6() {
        List<VideoTop> videoList = null;
        videoList = paihangbangMapper.searchPaihangbangTop6();
        return videoList;
    }

    @Override
    public List<VideoTop> getPaihangbangTop4() {
        List<VideoTop> videoList = null;
        videoList = paihangbangMapper.getPaihangbangTop4();
        return videoList;
    }
}
